package com.zhiyu.service;

import com.zhiyu.common.BaseService;
import com.zhiyu.mapper.UserMapper;
import com.zhiyu.pojo.User;
import org.springframework.stereotype.Service;

@Service
public class UserService extends BaseService<UserMapper, User> {
    public String login(User user){
        if(user.getUserName() == null || user.getPassword() == null){
            return "用户不存在";
        }
        //校验该用户
        User userCheck = mapper.selectByUser(user);
        if(userCheck != null){
            String userStr = userCheck.getUserId()+":"+userCheck.getUserName();
            return userStr;
        }else{
            return "用户不存在";
        }
    }
}